#!/bin/sh
TIME=`date -d "-1 day" "+%Y-%m-%d"`
#TIME=`date +%Y-%m-%d`
cd /root/backup/log
#wget -c -t 0  http://account.trinitigame.com/auditlog/devildark.log.$TIME
#wget -c -t 0  http://account.trinitigame.com/auditlog/devildark.log.$TIME.tar.gz
#tar zxvf devildark.log.$TIME.tar.gz
#sleep 20s
#sed -i -e '/whatday/!d' devildark.log.$TIME
sleep 25s
more /root/backup/log/devildark.log.$TIME|cut -b22- >/root/backup/log/devildark/$TIME
sleep 15s
cd /root/backup/log/devildark/
split -l 30000 $TIME $TIME
sleep 30s
cp /root/backup/log/devildark/$TIME'aa' /var/www/log/devildark/log
#cp /root/backup/log/devildark/$TIME'ab' /var/www/log/devildark/logb
sleep 30s
php -q /var/www/log/devildark/trunk/truncate.php
sleep 30s
php -q /var/www/log/devildark/trunk/devildark.php
sleep 30s
php -q /var/www/log/devildark/trunk/del.php
#sleep 30s
rm -rf  /root/backup/log/devildark/$TIME*
sleep 30s
php -q /var/www/log/devildark/trunk/filter.php
sleep 30s
php -q /var/www/log/devildark/trunk/insert.php
sleep 30s
php -q /var/www/log/devildark/trunk/update.php
sleep 30s
php -q /var/www/log/devildark/trunk/report_nojailbreak.php
sleep 30s
php -q /var/www/log/devildark/trunk/report.php
#sleep 30s
#php -q /var/www/log/devildark/trunk/report_week_nojailbreak.php

